package cn.itcast.take_delivery.dao;

import java.util.Date;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.take_delivery.Promotion;
import cn.itcast.crm.domain.Customer;


public interface PromotionRepository extends JpaRepository<Promotion, Integer> {

	Page<Promotion> findAll(Pageable pageable);
	
	@Query("update Promotion set status = '2' where endDate < ? and status = '1'")
	@Modifying
	void updateStatus(Date date);


}
